package com.xfly.app.ui;

import android.os.Bundle;
import android.widget.ListView;

import com.ptmall.app.R;
import com.ptmall.app.base.BaseMvpActivity;
import com.ptmall.app.bean.ProductBean;
import com.ptmall.app.view.TitleBarView;
import com.xfly.app.adapter.MzGoodAdapter;
import com.xfly.app.bean.KcBean;
import com.xfly.app.bean.MzBean;

import java.util.List;

public class MzGoodListActivity extends BaseMvpActivity {

    List<MzBean.GoodsBean> list ;
    ListView listview;
    MzGoodAdapter mzGoodAdapter;
    TitleBarView title_bar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setView(R.layout.activity_mzgoodlist);
    }

    @Override
    public void initViews() {
        listview = findViewById(R.id.listview);
        title_bar = findViewById(R.id.title_bar);

        list = (List<MzBean.GoodsBean>) getIntent().getSerializableExtra("goodlist");

        mzGoodAdapter = new MzGoodAdapter(getContext(),list);
        listview.setAdapter(mzGoodAdapter);
    }

    @Override
    public void initEvents() {
        title_bar.setText("活动商品");
        title_bar.setOnTitleBarClickListener(new TitleBarView.TitleBarClickListener() {
            @Override
            public void leftClick() {
                finish();
            }

            @Override
            public void rightClick() {

            }
        });
    }
}
